﻿using System;

using Fuse8.DomainFramework.Domain;

using Fuse8.ContentManagementFramework.Domain.Commands.CommandParameters;

namespace Fuse8.ContentManagementFramework.Domain.Commands
{
    public abstract class CmsPageSelectOneCommand : BaseEntityParameterCommand<CmsPage, CmsPageSelectAllCommandParameter>
    {
        public override string CacheKey
        {
            get
            {
                return string.Format("PageId_{0};PublicPageId_{1};SiteGroup_{2};Site_{3};SystemLanguage_{4};PageKey_{5}",
                    CommandParameter.Id,
                    CommandParameter.PublicPageId.GetValueOrDefault(0),
                    CommandParameter.SiteGroupId.GetValueOrDefault(0),
                    CommandParameter.SiteId.GetValueOrDefault(0),
                    CommandParameter.SystemLanguageId.GetValueOrDefault(0),
                    CommandParameter.PageKey);
            }
        }

        public override string CommandName
        {
            get
            {
                return "CmsPageSelectOneCommand";
            }
        }
    }
}
